﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Xproject.Util;
namespace WeiXinProject
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");                        
            string t = CommonHelper.GetAppSettings("defaultController");
            string i = CommonHelper.GetAppSettings("defaultindex");
            string defaultController = string.IsNullOrEmpty(t)?"Shop":t ;
            string defaultIndex = string.IsNullOrEmpty(i)?"Index":i;
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = defaultController, action = defaultIndex, id = UrlParameter.Optional }
            );
        }
    }
}